package cn.ljy.uem.model;

import cn.ljy.authority.model.SysUser;
import cn.ljy.common.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;


/**
 * @description 工程日志类
 * @author 王秋林
 * @date 2023-1-16 17:45
 */
@ApiModel(value="工程日志")
@Data
@NoArgsConstructor
public class ProjectDaily extends BaseModel {
    @ApiModelProperty(value="UUID")
    private String id;

    @ApiModelProperty(value = "项目名称")
    @NotNull(message = "请选择作者")
    private Long authorId;;//作者-用户外键

    @NotNull(message = "工程日志类型不能为空")
    private Long typeId;//工程日志类型外键

    @NotBlank(message = "日志标题不能为空")
    @Length(min = 1, max = 30, message = "日志标题长度必须在 {min} - {max} 之间")
    private String title;//日志标题-账户外键 sys_user

    @NotBlank(message = "日志内容不能为空")
    private String content;//日志内容

    private Date createTime;//创建时间

    private Date updateTime;//修改时间

    private Boolean recycle;//所有日志都不做物理删除，true表示已经删除

   //非数据库字段
    private SysUser author;//作者-用户外键 sys_user
    private ProjectDailyType type;//工程日志类型外键
}
